package com.jerei.store.entity;

import java.util.Date;
import java.util.List;
import java.util.Objects;

public class Order extends BaseEntity{
    private static final long serialVersionUID = 6632603478341520085L;

    private Integer oid;  //订单数据id
    private Integer uid;   //用户id
    private String recvName;  //收货人
    private String recvPhone;  //收货电话
    private String recvProvince; //收货省
    private String recvCity; //收货市
    private String recvArea;  //收货区
    private String recvAddress; //收货详细地址
    private long price;  //订单金额
    private Date orderTime; //下单时间
    private Date payTime; //支付时间
    private Integer status; //状态 0-未支付 1-已支付 2-已取消 3-已关闭


    private List<OrderItem> lists;

    public List<OrderItem> getLists() {
        return lists;
    }

    public void setLists(List<OrderItem> lists) {
        this.lists = lists;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Order order = (Order) o;
        return oid.equals(order.oid);
    }

    @Override
    public int hashCode() {
        return Objects.hash(oid);
    }

    public Integer getOid() {
        return oid;
    }

    public void setOid(Integer oid) {
        this.oid = oid;
    }

    public Integer getUid() {
        return uid;
    }

    public void setUid(Integer uid) {
        this.uid = uid;
    }

    public String getRecvName() {
        return recvName;
    }

    public void setRecvName(String recvName) {
        this.recvName = recvName;
    }

    public String getRecvPhone() {
        return recvPhone;
    }

    public void setRecvPhone(String recvPhone) {
        this.recvPhone = recvPhone;
    }

    public String getRecvProvince() {
        return recvProvince;
    }

    public void setRecvProvince(String recvProvince) {
        this.recvProvince = recvProvince;
    }

    public String getRecvCity() {
        return recvCity;
    }

    public void setRecvCity(String recvCity) {
        this.recvCity = recvCity;
    }

    public String getRecvArea() {
        return recvArea;
    }

    public void setRecvArea(String recvArea) {
        this.recvArea = recvArea;
    }

    public String getRecvAddress() {
        return recvAddress;
    }

    public void setRecvAddress(String recvAddress) {
        this.recvAddress = recvAddress;
    }

    public long getPrice() {
        return price;
    }

    public void setPrice(long price) {
        this.price = price;
    }

    public Date getOrderTime() {
        return orderTime;
    }

    public void setOrderTime(Date orderTime) {
        this.orderTime = orderTime;
    }

    public Date getPayTime() {
        return payTime;
    }

    public void setPayTime(Date payTime) {
        this.payTime = payTime;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    @Override
    public String toString() {
        return "Order{" +
                "oid=" + oid +
                ", uid=" + uid +
                ", recvName='" + recvName + '\'' +
                ", recvPhone='" + recvPhone + '\'' +
                ", recvProvince='" + recvProvince + '\'' +
                ", recvCity='" + recvCity + '\'' +
                ", recvArea='" + recvArea + '\'' +
                ", recvAddress='" + recvAddress + '\'' +
                ", price=" + price +
                ", orderTime=" + orderTime +
                ", payTime=" + payTime +
                ", status=" + status +
                "} " + super.toString();
    }
}
